﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "IMenuItemDefinition.h"
#include "OwnerPtr.h"

namespace gcmp
{
    /// \brief MenuItemContainer控件数据定义接口
    class GCMP_GUI_BASE_INTERFACE_EXPORT IMenuItemContainerDefinition : public IMenuItemDefinition
    {
    public:
        /// \brief 创建IMenuItemContainerDefinition对象
        ///
        /// \param id       IMenuItemContainerDefinition的id,需保证唯一性
        /// \param commandId    命令ID
        /// \param caption    控件标题
        /// \return  创建出ICommandMenuItemDefinition对象。失败时返回空
        static OwnerPtr<IMenuItemContainerDefinition> Create(const std::wstring& id, const std::wstring& caption);

        /// \brief 添加item至最后
        ///
        /// \param IMenuItemDefinition    IMenuItemDefinition对象
        /// \return   true表示成功，如果已添加过pSubMenuItem,则返回false 
        virtual bool AddSubMenuItem(OwnerPtr<IMenuItemDefinition> pSubMenuItem) = 0;

        /// \brief 添加分割符
        ///
        /// \return   true表示成功，失败则返回false 
        virtual bool AddSeparator() = 0;
    };
}
